import App from './App'

//uni.$BaseUrl = 'http://192.168.112.189:9100/api/'
uni.$BaseUrl = 'https://api9527.pcmh.com.cn/api/'


//封装弹出提示信息
uni.$showMsg = function(title = '请求数据失败.', duration = 1500) {
	uni.showToast({
		title: title,
		duration: duration,
		icon: 'none'
	})
}

Vue.prototype.$eventHub = Vue.prototype.$eventHub || new Vue()

String.prototype.replaceAll = function(s1, s2) {
	return this.replace(new RegExp(s1, "gm"), s2);
}

uni.$localKeyName_User = 'userTicks' //登录票据名
//添加本地存储
uni.$cacheAdd = function(key, value) {
	uni.setStorageSync(key, value)
}
//读取本地存储
uni.$cacheRead = function(key) {
	return uni.getStorageSync(key)
}


// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif